/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xoskit.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __37F9D32B_31F4_455b_BEDD_5E9BE1EF8F71__
#define __37F9D32B_31F4_455b_BEDD_5E9BE1EF8F71__

namespace xos_common
{

    class mgr : public i_common
    {
    public:
        typedef xos::release_impl< mgr > T;

    public:
        mgr();
        ~mgr();

    public:
        static int static_init( xos_container::i_container* pContainer, i_common** ppv );
        static xos_container::i_container* container();
        static mgr::T* get();

        // 
        // i_common
        // 
	public:
        //
        // 需要释放
        //
        i_id_generator* id_generator();
        i_alloc* alloc();
        i_sha* sha();
        i_md5* md5();
        //
        // 不需要释放
        //
        i_misc* misc();

    protected:
        i_misc* m_pMisc;

    public:
        int put_back_to_pool();
        int init();
        int term();
    };

} // xos_common

#endif // __37F9D32B_31F4_455b_BEDD_5E9BE1EF8F71__
